import {payPost} from "@/services/pay/base-pay-request";
import {ResponseStructure} from "@/requestErrorConfig";
import {AlipayF2FRequest, AlipayF2FResponse} from "@/services/pay/types";

/**
 * 支付宝当面付专用POST请求
 * @param data
 * @param options 额外配置
 */
export async function payAlipayF2F<T>(data: AlipayF2FRequest, options?: Record<string, any>): Promise<ResponseStructure & {
  data?: AlipayF2FResponse
}> {
  return payPost<T>('/alipay/v2/f2f', data, {
    headers: {
      'X-Pay-Type': 'alipay',
    },
    ...options,
  });
}
